<%= form_for(@book) do |f| %>
  <% if @book.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@book.errors.count, "error") %> prohibited this book from being saved:</h2>

      <ul>
      <% @book.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :author %><br />
    <%= f.text_field :author %>
  </div>
  <div class="field">
    <%= f.label :publisher %><br />
    <%= f.text_field :publisher %>
  </div>
  <div class="field">
    <%= f.label :year %><br />
    <%= f.number_field :year %>
  </div>
  <div class="field">
    <%= f.label :total %><br />
    <%= f.number_field :total %>
  </div>
  <div class="field">
    <%= f.label :remain %><br />
    <%= f.number_field :remain %>
  </div>
  <div class="field">
    <%= f.label :total_grade %><br />
    <%= f.number_field :total_grade %>
  </div>
  <div class="field">
    <%= f.label :total_time %><br />
    <%= f.number_field :total_time %>
  </div>
  <div class="field">
    <%= f.label :image_url %><br />
    <%= f.text_field :image_url %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
